package com.example.myview;

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Created by lenovo on 2018/7/5.
 */

public class Myview extends LinearLayout{

    private TextView tv;
    private Button rightbut;
    private Button leftbut;

    public Myview(Context context) {
        super(context);
    }

    public Myview(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initView(context,attrs);
    }

    private void initView(Context context, AttributeSet attrs) {
        View inflate = inflate(context, R.layout.myview_layout, this);
        leftbut = inflate.findViewById(R.id.left_but);
        rightbut = inflate.findViewById(R.id.right_but);
        tv = inflate.findViewById(R.id.text);
        initData(context,attrs);

    }

    private void initData(Context context, AttributeSet attrs) {
        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MyView);


    }

}
